#!/bin/bash
i=1
cat $1 | while read
do
     echo $i        
     let i=$i+1
done | cat > $2
